﻿using System.Collections.Generic;
using System.Xml.Serialization;


namespace dlCentral.Settings.Data
{

    #region General Settings
    public class SettingsGeneral
    {
        public string CommPath { get; set; }
        public string CommTimeOut { get; set; }
    }
    #endregion


    #region SiteTypes
    public class SettingsSiteTypes
    {
        [XmlIgnore]
        private List<SiteType> _SiteTypes;

        [XmlElement("SiteTypes")]
        public List<SiteType> SiteTypes
        {
            get { return _SiteTypes ?? (_SiteTypes = new List<SiteType>()); }
            set
            {
                if (_SiteTypes == null) _SiteTypes = new List<SiteType>();
                _SiteTypes = value;
            }
        }


    }

    public class SiteType
    {
        public string SiteTypeCode { get; set; }
        public string SiteTypeDescription { get; set; }
    }
    #endregion


    #region Protocol
    public class SettingsProtocols
    {
        [XmlIgnore]
        private List<ProtocolType> _Protocol;

        [XmlElement("Protocol")]
        public List<ProtocolType> Protocol
        {
            get { return _Protocol ?? (_Protocol = new List<ProtocolType>()); }
            set
            {
                if (_Protocol == null) _Protocol = new List<ProtocolType>();
                _Protocol = value;
            }
        }
 

    }

    public class ProtocolType
    {
        public string ProtocolCode { get; set; }
        public string ProtocolDescription { get; set; }
    }
    #endregion


    #region TVSeriesTranslation
    public class SettingsTVSeries
    {
        public string DefaultSeparator { get; set; }
        public string DefaultSeasonFormat { get; set; }
        public string DefaultEpisodeFormat { get; set; }
        [XmlIgnore]
        private List<TVSeries> _TVseries;

        [XmlElement("TVSeriesTranslation")]
        public List<TVSeries> TVseries
        {
            get { return _TVseries ?? (_TVseries = new List<TVSeries>()); }
            set
            {
                if (_TVseries == null) _TVseries = new List<TVSeries>();
                _TVseries = value;
            }
        }


    }

    public class TVSeries
    {
        public string OriginalName { get; set; }
        public string ModifiedName { get; set; }
        public string Separator { get; set; }
        public string SeasonFormat { get; set; }
        public string EpisodeFormat { get; set; }
    }
    #endregion


    #region Sites
    public class SettingsSites
    {
        public SettingsSites()
        {
            //OnDownloadFileName = OnDownloadFileName.AskIfManual;
        }

//        public OnDownload OnDownload { get; set; }
//        public OnDownloadFileName OnDownloadFileName { get; set; }

        [XmlIgnore]
        private List<SettingsSite> _Sites;
 
        [XmlElement("Site")]
        public List<SettingsSite> Sites
        {
            get { return _Sites ?? (_Sites = new List<SettingsSite>()); }
            set
            {
                if (_Sites == null) _Sites = new List<SettingsSite>();
                _Sites = value;
            }
        }
    }

    public class SettingsSite
 
    {
        private List<string> _TVRemoteDirs;
        private List<string> _MovieRemoteDirs;
        private List<string> _MP3RemoteDirs;
        public string SiteType { get; set; }
        public string SiteName { get; set; }
        public string Host { get; set; }
        public string Protocol { get; set; }
        public bool PASV { get; set; }
        public string Port { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public string TVLocalDir { get; set; }
        public string MovieLocalDir { get; set; }
        public string MP3LocalDir { get; set; }
        public string SearchTerm { get; set; }

        public List<string> TVRemoteDirs
        {
            get { return _TVRemoteDirs ?? (_TVRemoteDirs = new List<string>()); }
            set
            {
                if (_TVRemoteDirs == null) _TVRemoteDirs = new List<string>();
                _TVRemoteDirs = value;
            }
        }
        public List<string> MovieRemoteDirs
        {
            get { return _MovieRemoteDirs ?? (_MovieRemoteDirs = new List<string>()); }
            set
            {
                if (_MovieRemoteDirs == null) _MovieRemoteDirs = new List<string>();
                _MovieRemoteDirs = value;
            }
        }
        public List<string> MP3RemoteDirs
        {
            get { return _MP3RemoteDirs ?? (_MP3RemoteDirs = new List<string>()); }
            set
            {
                if (_MP3RemoteDirs == null) _MP3RemoteDirs = new List<string>();
                _MP3RemoteDirs = value;
            }
        }

    }

    #endregion

    #region GUI
    public class SettingsGUI {
        public SettingsGUI() {
            SortMethod = ItemSortMethod.ItemName;
            SortAscending = true;
            PluginName = "dlCentral";
            HidePlugin = false;
        }

        public ItemSortMethod SortMethod { get; set; }
        public bool SortAscending { get; set; }
        public string PluginName { get; set; }
        public bool HidePlugin { get; set; }
    }
    #endregion
}
